/*
 * Created: 2022-09-12 15:56:47
 * Author : 涛涛涛
 */

import React, { FC } from 'react';
import { View, Text } from '@tarojs/components';
import { styled } from 'linaria/react';
import { useClassName } from '@/utils/index';
import Taro from '@tarojs/taro';
export interface IProps extends ICompProps {}
LeftArrow.defaultProps = {} as Partial<IProps>;
function LeftArrow(props: IProps) {
    const { className, style } = props;
    const localClassName = useClassName('LeftArrow', className);
    // 跳转到上一页
    const gotoBack = () => {
        Taro.navigateBack({});
    };
    return (
        <RootView className={localClassName} style={style}>
            <View className="arrow-wrap">
                <Text className="iconfont" onClick={() => gotoBack()}>
                    &#xe625;
                </Text>
            </View>
        </RootView>
    );
}
export default React.memo(LeftArrow as FC<IProps>);
const RootView = styled(View)`
    &.LeftArrow {
        display: flex;
        align-items: center;
        .arrow-wrap {
            margin: -20px;
            margin-left: -30px;
            > .iconfont {
                padding: 20px;
                font-size: 40px;
                line-height: 1;
            }
        }
    }
`;
